<?php 
include_once("clases/Conexion.php");
include_once("clases/SubMenuManager.php");

$link = new Conexion("localhost","root", "root", "menues");
$objsubmenues = new SubMenuManager();
$array_submenues = $objsubmenues->getSubMenu($_GET['id']);


?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="css/style.css" rel="stylesheet" type="text/css"  />
 <script type="text/javascript" src="./js/jquery.easing.1.3.js"></script>
 <script type="text/javascript" src="./js/cargarCombo.js"></script>
 <script type="text/javascript" src="./js/jquery-latest.js"></script>
        <link rel="stylesheet" href="css/thickbox.css" type="text/css" />
        <script type="text/javascript" src="./js/thickbox.js"></script>
 <script type="text/javascript" src="./js/validarFormularioSubRubro.js"></script>
</head>

    <body onload="cargarMenuEnSubmenues();mostrarImput();">
    <center>
        <fieldset>
           <legend>Editar SubMenú/Item</legend>
             <form name="frmsubmenu" method="post" enctype="multipart/form-data" action="index.php?accion=updateSubMenu">
               <input type="hidden" name="id" value="<?php echo $array_submenues[0]['id'] ?>" />
               <input type="hidden" name="tituloOld" value="<?php echo $array_submenues[0]['titulo1'] ?>" />
               <input type="hidden" id="idmenu" name="idmenu" value="<?php echo $array_submenues[0]['idmenu'] ?>" />
               <label>Menú Padre:</label><br/>
                <select id="buscarMenu" name="idmenu">

            </select><br/>
               <label>Item o Submenu:</label><br/>
             <select id="item" name="item" onchange="javascript:mostrarImput()">
                          <option value="item"<?php if($array_submenues[0]['esitem']== 1){ echo "selected";} ?>>Item</option>
                          <option value="submenu"<?php if($array_submenues[0]['esitem']== 0){ echo "selected";} ?>>SubMenu</option>
             </select>
              <table id="TablaItemSubmenu" align="center">
                  <tr id="rowIcono">
                    <td>
                        <label>Icono Actual:</label>
                    </td>
                    <td>
                        <img src="<?php echo "." . $array_submenues[0]['icono'] ?>" id="imagIcono"/>
                    </td>
                  </tr>
                  <tr id="rowIcono1">
                    <td>
                        <label>Modificar icono:</label>
                    </td>
                    <td>
                        <input type="file" name="icono1" id="icono" accept="image"/>
                    </td>
                  </tr>
                  <tr>
                    <td>
                        <label>Titulo:</label>
                    </td>
                    <td>
                        <input type="text" id="titulo1" name="titulo1" value="<?php echo $array_submenues[0]['titulo1'] ?>"/>
                    </td>
                  </tr>

              </table><br/><br/>
               <input type="button" name="btnregresar" value=":: REGRESAR ::" onclick="javascript:self.parent.tb_remove('S');" />
               <input type="button" name="btngrabar" value=":: ACTUALIZAR ::" onclick="javascript:validarSubRubro('ES');"/><br/><br/>
             </form>
        </fieldset>
    </center>
</body>
</html>